import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;

public class Test {
    public static void main(String[] args) {
        SimpleEmail email = new SimpleEmail();
        email.setSslSmtpPort("465");//qq邮件服务器的端口号
        email.setHostName("smtp.qq.com");
        email.setAuthentication("2507589553@qq.com","hxclhasnclbfeaed");
        email.setCharset("UTF-8");
        try {
            email.addTo("3209085571@qq.com");
            email.setFrom("2507589553@qq.com");
            email.setSubject("Hello");
            email.setMsg("come back");
            email.send();
        } catch (EmailException e){
            e.printStackTrace();
        }
    }
}